package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_circle_cate;

//DAO
public interface U_circle_cateMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_CIRCLE_CATE  WHERE ID = #{id}")
	public ApiU_circle_cate findU_circle_cateById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_circle_cate")
	public List<ApiU_circle_cate> findU_circle_cates();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_circle_catesByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO U_CIRCLE_CATE (PARENT_ID, CATE_NAME, CATE_DESC, SORT, TYPE,iconurl,is_delete) VALUES (#{parent_id}, #{cate_name}, #{cate_desc}, #{sort}, #{type},#{iconurl},#{is_delete})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertU_circle_cate(ApiU_circle_cate u_circle_cate);

	// 修改
	@Update("UPDATE U_CIRCLE_CATE SET PARENT_ID = #{parent_id}, CATE_NAME = #{cate_name}, CATE_DESC = #{cate_desc}, SORT = #{sort}, TYPE = #{type},iconurl = #{iconurl},is_delete = #{is_delete} WHERE ID = #{id}")
	public int updateU_circle_cate(ApiU_circle_cate u_circle_cate);

	// 删除
	// @Delete("DELETE FROM U_CIRCLE_CATE WHERE ID = #{id}")
	@Update("UPDATE U_CIRCLE_CATE SET is_delete =1 WHERE ID = #{id}")
	public int deleteU_circle_cate(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
